{% extends 'employees/base_module.html' %}
{% load i18n material_frontend %}

{% block breadcrumbs_items %}
<a href="{% url employee|frontend_urlname:'list' %}">{{ employee|verbose_name_plural|title }}</a>
<a href="{% url employee|frontend_urlname:'detail' employee.pk %}">{{ employee }}</a>
<a class="active">{% trans 'Change Title' %}</a>
{% endblock %}

{% block content %}
<div class="left-panel">
    <div class="card">
      <dmc-form>
        <form method="POST">
            {% csrf_token %}
            <div class="card-content">
                <div class="card-title">{% trans 'Positions' %}</div>
                <table>
                    <thead>
                        <tr>
                            <td>{% trans 'Position' %}</td>
                            <td>{% trans 'Since' %}</td>
                            <td>{% trans 'To' %}</td>
                        </tr>
                    </thead>
                    <tbody>
                        {% for title in employee.title_set.all %}
                        <tr>
                            <td>{{ title.title }}</td>
                            <td>{{ title.from_date }}</td>
                            <td>{{ title.to_date }}</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
                {{ form }}
            </div>
            <div class="card-action right-align">
                <button type="submit" class="btn">{% trans 'Change' %}</button>
            </div>
        </form>
      </dmc-form>
    </div>
</div>
{% endblock %}
